// custom-tab-bar/index.js
const app = getApp()

Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    tabIndex: 0,
    list:[
      {
        "pagePath": "/pages/index/index",
        "text": "首页",
        "iconPath": "/images/shubao-2.png",
        "selectedIconPath": "/images/shubao-1.png"
      },
      {
        "pagePath": "/pages/smjs/smjs",
        "text": "借阅",
        "iconPath": "/images/shaoma-2.png",
        "selectedIconPath": "/images/shaoma-1.png"
      },
      {
        "pagePath": "/pages/manage/manage",
        "text": "管理",
        "iconPath": "/images/wode-2.png",
        "selectedIconPath": "/images/wode-1.png"
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e) {
      let url = e.currentTarget.dataset.url
      let index = e.currentTarget.dataset.index
      wx.switchTab({
        url
      })
      wx.setStorageSync('tabIndex', index)
    },
  }
})
